找传奇、传世资源到传世资源站!

C# 获取本机已登陆的QQ号码

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

原理:利用qq的快速登陆功能提取已经登陆的qq号信息
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Text.RegularExpressions;namespace GetLoginQQDemo{public partial class Form1 : Form{private string url = "http://xui.ptlogin2.qq.com/cgi-bin/qlogin?domain=qq.com&amp;lang=2052&amp;qtarget=1&amp;jumpname=&amp;appid=549000912&amp;ptcss=undefined&amp;param=u1%253Dhttp%25253A%25252F%25252Fqun.qzone.qq.com%25252Fgroup&amp;css=&amp;mibao_css=&amp;s_url=http%253A%252F%252Fqun.qzone.qq.com%252Fgroup&amp;low_login=0&amp;style=12&amp;authParamUrl=&amp;needVip=1&amp;ptui_version=10028";private WebBrowser web = new WebBrowser();public Form1(){InitializeComponent();lvwUins.Columns.Add("昵称", 100);lvwUins.Columns.Add("QQ号码", 100);web.Url = new Uri(url);}private void button1_Click(object sender, EventArgs e){if(web.ReadyState != WebBrowserReadyState.Complete){MessageBox.Show("网页尚未加载完毕,请稍等.");return;}lvwUins.Items.Clear();HtmlDocument doc = web.Document;HtmlElement uinList = doc.GetElementById("list_uin");if(uinList != null){for (int i = 0; i < uinList.Children.Count; i ) {string str = uinList.Children[i].InnerText.Trim();//分割昵称和QQ号码string[] temp = str.Split(' ');string nick = temp[0];string uin = temp[1];//去除括号uin = uin.Replace("(", "").Replace(")", "");ListViewItem item = new ListViewItem();item.Text = nick;item.SubItems.Add(uin);lvwUins.Items.Add(item);}}}}}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复